package Resource;

public class Resource_Bitmap2D extends Resource{

private int data [] [];	
	



public Resource_Bitmap2D(int xDimension,int yDimension)
{
	data = new int [xDimension] [yDimension];
	
	
}


/**
 * 
 * @param xPos
 * @param yPos
 * @param color
 * @return
 */

public boolean setPixel(int xPos, int yPos, int color)
{
	
	if ((xPos>=data.length) || (yPos>=data[0].length))
		return(false);
	
	data[xPos] [yPos]=color;
	
	return(true);
}

/**
 * 
 * @param xPos
 * @param yPos
 * @return
 */

public int getPixel(int xPos,int yPos)
{
	if ((xPos>=data.length) || (yPos>=data[0].length))
		return(-1);
	
	
	return(	data[xPos] [yPos]);
}

/**
 * 
 * 
 */

public void clean()
{
	int xCounter;
	int yCounter;

	
	for (xCounter=0;xCounter<data.length; xCounter++)
		for (yCounter=0;yCounter<data[0].length; yCounter++)
			data[xCounter] [yCounter]=0;
}



	
}
